Skip to content

Self-service account deletion; remove the public template Terms page - #141

Merged
Darknode-Official merged 1 commit into
mainfrom
feat/account-delete
Nov 28, 2026
Merged

Darknode-Official merged 1 commit into
mainfrom
feat/account-delete

Conversation

@Darknode-Official

Copy link
Copy Markdown
Owner

Before this, users had no working way to delete an account. The Deck had no option. The older settings page filed a deletionRequests doc that nothing read. The Terms said to email contact@darknode.ai, an inbox that isn't confirmed.

What it does

  • New Worker route POST /api/account/delete. It needs a sign-in from the last 5 minutes and {"confirm":"DELETE"}. It deletes, in order:
    • the personal workspace's graph, monitors (including the free domain watch) and API keys (Durable Objects);
    • team workspaces and vaults the user holds alone;
    • their member docs in other spaces;
    • every Firestore record naming them: users/{uid} and its subcollections, usage, deletionRequests, pairings, upgrade and tool requests, feedback, error and IP reports, their waitlist entry;
    • the Firebase Auth account, last.
  • If the user created a workspace that still has other members, the call returns 409 and names it, before anything is deleted. Running it again finishes a deletion that stopped partway.
  • Each Durable Object gets an internal /__wipe route. Every user-facing forward builds a fixed path (/ or /findings), so outside requests can't reach it.
  • UI, all through public/js/account-delete.js: Deck Settings > Data > Delete account, the older settings page, and the Verify-your-email screen (unverified sign-ups couldn't delete before). The user types DELETE and signs in again if the sign-in is old. Only this account's browser data is then cleared, so other accounts on a shared browser keep theirs.
  • Terms, Privacy and Docs now describe the self-service path. Wording only, so no TOS_VERSION bump.
  • /legal/terms-of-service.html was an unfilled template with 21 [SPECIFY ...] placeholders, live on darknode.ai and contradicting the real Terms. It's moved to unused-stuff/ and the URL now 301s to /terms on both hosting sites.

Verified

  • npm test: 5174 passed. 8 new tests cover: what's deleted and what's kept, the blocking workspace, the stale sign-in, the missing confirm word, a failure stopping before the Auth delete, a retry, and the wipe route guard.
  • Staging Worker deployed (40308b4b). Unsigned and forged-token calls get 401.
  • End to end through the UI: local build pointed at staging, with a throwaway account seeded with a users doc and a config subdoc. Delete this account, type DELETE, then the "Your account is deleted" dialog, signed out, home page. Signing up again with the same email succeeded, which proves the old account was gone; that second account was then deleted.

Not tested: the Deck Settings row with a verified account (Test Mode has no account, so the row is hidden; it uses the same module), and re-sign-in by Google popup.

Deploy: Worker first, then hosting. Production not deployed.

Deleting an account used to mean filing a request that nothing read (the
deletionRequests docs had no reader) or emailing an unconfirmed inbox, and the
Deck had no way to do it at all.

- Worker POST /api/account/delete (signed in within the last 5 minutes,
  body {"confirm":"DELETE"}): wipes the personal workspace's graph, monitors and
  API keys; deletes team workspaces and vaults the user holds alone; removes
  their member docs elsewhere and every Firestore record that names them; then
  deletes the Firebase Auth account last. A workspace they created that still
  has members blocks deletion (409) before anything is touched. Retrying
  finishes a half-done deletion.
- Each Durable Object answers an internal /__wipe route that no user-facing
  forward can reach (they all use fixed paths).
- Deck Settings > Data > Delete account, the older settings page, and the
  "Verify your email" screen (unverified sign-ups could not delete at all) use
  public/js/account-delete.js: type DELETE, sign in again if needed, then this
  account's browser data is cleared.
- Terms/Privacy/Docs describe the self-service path (wording only, no
  TOS_VERSION bump).
- public/legal/terms-of-service.html was an unfilled template with 21
  "[SPECIFY ...]" placeholders served publicly; moved to unused-stuff/ and the
  URL now redirects to /terms.
@Darknode-Official
Darknode-Official merged commit 1c1b206 into main Nov 28, 2026
10 checks passed
@Darknode-Official
Darknode-Official deleted the feat/account-delete branch November 28, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant